<?php
global $jbconfig;
defined('_JEXEC') or die('Retricted Access');
	global $option;
	$user = JFactory::getUser();
	$user = JFactory::getUser($user->id);
	if ($user->get('lastvisitDate') == "0000-00-00 00:00:00") {
		$lvisit = JText::_( 'Never' );
	} else {
		$lvisit	= generateDate($user->get('lastvisitDate'));
	}
	$user_type = JRequest::getVar('user_type');
?>			
<div id="jobboard-content">	
	<form name="userdetailForm" action="index.php" method="post">
		
		<table class="tabledata userdetails">
			<tr>
				<td>
				<?php if (getCurrentUserType()=='Guest') { ?>
					<?php echo JText::_('You don\'t have update your information detail!'); ?>
					<a class="button" href="<?php echo JRoute::_( 'index.php?option=com_jajobboard&view=usergroup'); ?>"><?php echo JText::_('Update now'); ?></a>
				<?php } ?>
				</td>
			</tr>
		</table>
		
		<div class="moduletable userdetail-box">
	        <h3>
		         <?php echo JText::_( 'User Details' ); ?>
		    </h3>
		    <table class="tabledata userdetails">												
				<tr class="first">
					<td width="150" class="key">
						<label for="name">
							<?php echo JText::_( 'Name' ); ?>:
						</label>
					</td>
					<td>
						<?php echo $user->get('name'); ?>
					</td>
				</tr>
				<tr>
					<td class="key">
						<label for="username">
							<?php echo JText::_( 'Username' ); ?>:
						</label>
					</td>
					<td>
						<?php echo $user->get('username'); ?>
					</td>
				</tr>
				<tr>
					<td class="key">
						<label for="email">
							<?php echo JText::_( 'Email' ); ?>:
						</label>
					</td>
					<td>
						<?php echo $user->get('email'); ?>
					</td>
				</tr>
				
				<?php  if( $user->get('id') ) { ?>
				<tr>
					<td class="key">
						<?php echo JText::_( 'Register Date' ); ?>:
					</td>
					<td>
						<?php echo generateDate($user->get('registerDate'));?>
					</td>
				</tr>
				<tr>
					<td class="key">
						<?php echo JText::_( 'Last Visit Date' ); ?>:
					</td>
					<td>
						<?php echo $lvisit; ?>
					</td>
				</tr>
				<?php } ?>
				<tr class="last">
					<td colspan="2"><a class="button" href="index.php?option=com_user&view=user&task=edit"><?php echo JText::_('Edit'); ?></a></td>
				</tr>
			</table>
		</div>
			
		<input type="hidden" name="cid" value="<?php echo $user->id; ?>" />
		<input type="hidden" name="option" value="<?php echo $option; ?>" />
		<input type="hidden" name="view" value="usergroup" />
		<input type="hidden" name="task" value="" />
		<?php echo JHTML::_( 'form.token' ); ?>	
		
		        
	</form>		
</div>